var mongoose = require('mongoose');

var user_data = {
	name:String,
	password:String,
	salt:String
};
var user_schema = mongoose.Schema(user_data, {versionKey: false});
var User = mongoose.model('User', user_schema);

var budget_data = {
	owner: String,
	name: String,
}
var budget_schema = mongoose.Schema(budget_data, {versionKey: false});
var Budget = mongoose.model('Budget', budget_schema);

var income_data = {
	owner: String, 
	name: {type: String, default: 'New Income'},
	amount: {type: Number, default: 10000},
	frequency: {type: Number, default: 30},
	budget: {type: String, default: -1}
};
var income_schema = mongoose.Schema(income_data, {versionKey: false});
var Income = mongoose.model('Income', income_schema); 

var expense_data = {
	owner: String,
	name: {type: String, default: 'New Expense'},
	amount: {type: Number, default: 100},
	frequency: {type: Number, default: 30},
	budget: {type: String, default: -1}
};
var expense_schema = mongoose.Schema(expense_data, {versionKey: false});
var Expense = mongoose.model('Expense', expense_schema);

exports.income = Income;
exports.expense = Expense;

exports.user = User;
exports.budget = Budget;